package tugou

type sessionDynamicModule struct { //动态模块session
	sessionInfo
	state int //状态
	msg   chan<- messageToDynamicOrFix
	shut  chan<- string //关闭
}

func (this *sessionDynamicModule) send(msg *messageToDynamicOrFix) {
	msg.to = &this.sessionInfo
	this.msg <- *msg
}

type sessionDynamic struct { //动态模块的类型session
	my sessionMy
	sessionDynamicModule
}

func (this *sessionDynamic) getSelf() *sessionDynamic {
	return this
}

//发送到模块的通过客户端
func (this *sessionDynamic) sendByClient(data interface{}, funcName string) error {
	msg := &messageToDynamicOrFix{}
	msg.fr = this.my
	msg.data = data
	this.sessionDynamicModule.send(msg)
}

//获取
type SessionDynamic interface { //动态模块的的session
	SessionInfo
	sendByClient(data interface{}, funcName string) error
	getSelf() *sessionDynamic
}
